<template>
  <div class="personnel-portrait-view">
    <!-- 左侧：人员列表 -->
    <div class="personnel-list-panel">
      <div class="panel-header">
        <div class="header-title">人员综合评分</div>
        <div class="header-subtitle" v-if="!loading">共 {{ totalCount }} 人</div>
        <div class="header-subtitle" v-else>加载中...</div>
      </div>
      
      <div class="personnel-list-container" v-if="!loading && !error">
        <div 
          v-for="(person, index) in sortedPersonnel" 
          :key="index"
          class="personnel-list-item"
          :class="{ active: selectedPerson === person }"
          @click="selectPerson(person)"
        >
          <div class="person-rank" :class="getRankClass(person['排名'])">
            {{ person['排名'] || index + 1 }}
          </div>
          <div class="person-info">
            <div class="person-name">{{ person['姓名'] }}</div>
            <div class="person-branch">{{ formatBranchName(person['支行']) }}</div>
            <div class="person-position">{{ person['行政职务'] }}</div>
          </div>
          <div class="person-score">
            <div class="score-value" :class="getScoreClass(person['综合得分'])">
              {{ formatNumber(person['综合得分']) }}
            </div>
            <div class="score-label">分</div>
          </div>
        </div>
      </div>
      
      <!-- 左侧加载状态 -->
      <div v-else-if="loading" class="list-loading">
        <div class="loading-spinner-small"></div>
        <div class="loading-text-small">正在加载人员数据...</div>
      </div>
      
      <!-- 左侧错误状态 -->
      <div v-else-if="error" class="list-error">
        <div class="error-icon">⚠️</div>
        <div class="error-text">{{ error }}</div>
        <button @click="loadData" class="retry-btn">重试</button>
      </div>
    </div>

    <!-- 右侧：人员详情 -->
    <div class="personnel-detail-panel">
      
      <div v-if="!selectedPerson" class="no-selection">
        <div class="no-selection-icon">👤</div>
        <div class="no-selection-text">请从左侧列表选择一个人员查看详情</div>
      </div>

      <!-- 人员详情内容 -->
      <div v-else class="personnel-content">
        <!-- 人员标题区 -->
        <div class="personnel-header">
          <div class="personnel-title">
            <h2>{{ selectedPerson['姓名'] }}</h2>
            <div class="title-meta">
              <span class="meta-item">{{ selectedPerson['行政职务'] }}</span>
              <span class="meta-divider">|</span>
              <span class="meta-item">{{ formatBranchName(selectedPerson['支行']) }}</span>
            </div>
          </div>
          <div class="personnel-score-display">
            <div class="score-circle" :class="getScoreClass(selectedPerson['综合得分'])">
              <div class="score-number">{{ formatNumber(selectedPerson['综合得分']) }}</div>
              <div class="score-text">综合评分</div>
            </div>
          </div>
        </div>

        <!-- 基本信息卡片 -->
        <div class="detail-section">
          <div class="section-title">基本信息</div>
          <div class="info-grid">
            <div class="info-item">
              <div class="info-label">机构号</div>
              <div class="info-value">{{ selectedPerson['支行机构号'] }}</div>
            </div>
            <div class="info-item">
              <div class="info-label">当前排名</div>
              <div class="info-value rank-value">
                <span class="rank-badge" :class="getRankClass(selectedPerson['排名'])">
                  #{{ selectedPerson['排名'] }}
                </span>
              </div>
            </div>
            <div class="info-item">
              <div class="info-label">上季度排名</div>
              <div class="info-value">{{ selectedPerson['上季度排名'] || '-' }}</div>
            </div>
            <div class="info-item">
              <div class="info-label">排名变化</div>
              <div class="info-value">
                <span :class="getRankChangeClass(selectedPerson['上季度排名减去本季度排名'])">
                  {{ formatRankChange(selectedPerson['上季度排名减去本季度排名']) }}
                </span>
              </div>
            </div>
            <div class="info-item">
              <div class="info-label">任职开始时间</div>
              <div class="info-value">{{ formatDate(selectedPerson['任职开始时间时间']) }}</div>
            </div>
            <div class="info-item">
              <div class="info-label">数据时点</div>
              <div class="info-value">{{ formatDate(selectedPerson['数据时点']) }}</div>
            </div>
          </div>
        </div>

        <!-- 绩效得分详情 -->
        <div class="detail-section">
          <div class="section-title">绩效得分明细</div>
          <div class="score-details">
            <div class="score-detail-item">
              <div class="score-detail-header">
                <span class="score-detail-name">业务发展</span>
                <span class="score-detail-value" :class="getScoreClass(selectedPerson['业务发展得分(30分)'])">
                  {{ formatNumber(selectedPerson['业务发展得分(30分)']) }} / 30
                </span>
              </div>
              <div class="score-progress-bar">
                <div class="progress-fill" 
                     :style="{ width: getPercentage(selectedPerson['业务发展得分(30分)'], 30) }"
                     :class="getScoreClass(selectedPerson['业务发展得分(30分)'])">
                </div>
              </div>
            </div>

            <div class="score-detail-item">
              <div class="score-detail-header">
                <span class="score-detail-name">财务状况</span>
                <span class="score-detail-value" :class="getScoreClass(selectedPerson['财务状况得分(25分)'])">
                  {{ formatNumber(selectedPerson['财务状况得分(25分)']) }} / 25
                </span>
              </div>
              <div class="score-progress-bar">
                <div class="progress-fill" 
                     :style="{ width: getPercentage(selectedPerson['财务状况得分(25分)'], 25) }"
                     :class="getScoreClass(selectedPerson['财务状况得分(25分)'])">
                </div>
              </div>
            </div>

            <div class="score-detail-item">
              <div class="score-detail-header">
                <span class="score-detail-name">资产质量</span>
                <span class="score-detail-value" :class="getScoreClass(selectedPerson['资产质量得分(33分)'])">
                  {{ formatNumber(selectedPerson['资产质量得分(33分)']) }} / 33
                </span>
              </div>
              <div class="score-progress-bar">
                <div class="progress-fill" 
                     :style="{ width: getPercentage(selectedPerson['资产质量得分(33分)'], 33) }"
                     :class="getScoreClass(selectedPerson['资产质量得分(33分)'])">
                </div>
              </div>
            </div>

            <div class="score-detail-item">
              <div class="score-detail-header">
                <span class="score-detail-name">风险管理</span>
                <span class="score-detail-value" :class="getScoreClass(selectedPerson['风险管理得分（6分）'])">
                  {{ formatNumber(selectedPerson['风险管理得分（6分）']) }} / 6
                </span>
              </div>
              <div class="score-progress-bar">
                <div class="progress-fill" 
                     :style="{ width: getPercentage(selectedPerson['风险管理得分（6分）'], 6) }"
                     :class="getScoreClass(selectedPerson['风险管理得分（6分）'])">
                </div>
              </div>
            </div>

            <div class="score-detail-item">
              <div class="score-detail-header">
                <span class="score-detail-name">中间业务</span>
                <span class="score-detail-value" :class="getScoreClass(selectedPerson['中间业务得分（6分）'])">
                  {{ formatNumber(selectedPerson['中间业务得分（6分）']) }} / 6
                </span>
              </div>
              <div class="score-progress-bar">
                <div class="progress-fill" 
                     :style="{ width: getPercentage(selectedPerson['中间业务得分（6分）'], 6) }"
                     :class="getScoreClass(selectedPerson['中间业务得分（6分）'])">
                </div>
              </div>
            </div>
          </div>
        </div>

        <!-- 其他指标 -->
        <div class="detail-section">
          <div class="section-title">其他指标</div>
          <div class="info-grid">
            <div class="info-item">
              <div class="info-label">分支机构调节系数</div>
              <div class="info-value">{{ selectedPerson['分支机构调节系数'] || '-' }}</div>
            </div>
            <div class="info-item">
              <div class="info-label">风险合规指标</div>
              <div class="info-value">{{ formatNumber(selectedPerson['每个季度风险合规指标(2025Q3)']) }}</div>
            </div>
            <div class="info-item">
              <div class="info-label">处罚扣分项</div>
              <div class="info-value">{{ selectedPerson['个人内外部处罚扣分项'] || 0 }}</div>
            </div>
            <div class="info-item">
              <div class="info-label">加分项</div>
              <div class="info-value">{{ selectedPerson['加分项'] || 0 }}</div>
            </div>
            <div class="info-item">
              <div class="info-label">Q3KPI排名</div>
              <div class="info-value">{{ selectedPerson['Q3KPI排名'] || '-' }}</div>
            </div>
            <div class="info-item">
              <div class="info-label">与KPI的差别</div>
              <div class="info-value">{{ selectedPerson['与KPI的差别'] || '-' }}</div>
            </div>
          </div>
        </div>

        <!-- 评价与建议 -->
        <div class="detail-section" v-if="selectedPerson['评价汇总'] || selectedPerson['总体评价'] || selectedPerson['建议']">
          <div class="section-title">评价与建议</div>
          <div class="evaluation-content">
            <div v-if="selectedPerson['评价汇总']" class="eval-item">
              <div class="eval-label">评价汇总</div>
              <div class="eval-text">{{ selectedPerson['评价汇总'] }}</div>
            </div>
            <div v-if="selectedPerson['总体评价']" class="eval-item">
              <div class="eval-label">总体评价</div>
              <div class="eval-text">{{ selectedPerson['总体评价'] }}</div>
            </div>
            <div v-if="selectedPerson['建议']" class="eval-item">
              <div class="eval-label">改进建议</div>
              <div class="eval-text">{{ selectedPerson['建议'] }}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, computed, onMounted } from 'vue'

// 数据状态
const personnelData = ref([])
const selectedPerson = ref(null)
const loading = ref(true)
const error = ref(null)

// 加载JSON数据
const loadData = async () => {
  try {
    loading.value = true
    error.value = null
    
    // 尝试从多个可能的路径加载数据
    let jsonData = null
    let base = import.meta.env.BASE_URL || '/'
    
    // 确保base路径以/结尾
    if (base && !base.endsWith('/')) {
      base = base + '/'
    }
    
    console.log('当前BASE_URL:', base)
    console.log('当前环境:', import.meta.env.MODE)
    
    // 根据环境决定路径
    const paths = []
    
    if (import.meta.env.MODE === 'development') {
      // 开发环境：只尝试 /data/ 路径
      paths.push('/data/personnel_portrait.json')
    } else {
      // 生产环境：只尝试 /assets/ 路径
      paths.push(`${base}assets/personnel_portrait.json`)
    }
    
    // 尝试每个路径
    for (const path of paths) {
      try {
        // 清理多余的斜杠，但保留路径分隔符
        const normalizedPath = path.replace(/([^:]\/)\/+/g, '$1')
        console.log(`尝试加载: ${normalizedPath}`)
        
        const response = await fetch(normalizedPath)
        
        console.log(`响应状态: ${response.status} ${response.statusText}`)
        
        // 304 (Not Modified) 也是成功的响应
        if (response.ok || response.status === 304) {
          const contentType = response.headers.get('content-type')
          console.log(`内容类型: ${contentType}`)
          
          // 尝试解析JSON
          try {
            jsonData = await response.json()
            console.log(`✅ 成功从 ${normalizedPath} 加载数据`)
            break
          } catch (jsonError) {
            console.warn(`⚠️ JSON解析失败:`, jsonError.message)
          }
        } else {
          console.warn(`⚠️ HTTP ${response.status}: ${normalizedPath}`)
        }
      } catch (e) {
        console.log(`❌ 从 ${path} 加载失败:`, e.message)
      }
    }
    
    if (!jsonData) {
      throw new Error('无法从任何路径加载数据，请检查文件是否存在')
    }
    
    // 获取第一个工作表的数据
    const sheets = jsonData.sheets
    const firstSheetKey = Object.keys(sheets)[0]
    personnelData.value = sheets[firstSheetKey].data || []
    
    console.log(`成功加载 ${personnelData.value.length} 条人员数据`)
    
    // 自动选择第一个人
    if (personnelData.value.length > 0) {
      selectedPerson.value = personnelData.value[0]
    }
    
  } catch (err) {
    console.error('加载数据失败:', err)
    error.value = err.message
  } finally {
    loading.value = false
  }
}

// 计算属性：按排名排序的人员列表
const sortedPersonnel = computed(() => {
  if (!personnelData.value) return []
  
  return [...personnelData.value].sort((a, b) => {
    const rankA = a['排名'] || 999
    const rankB = b['排名'] || 999
    return rankA - rankB
  })
})

// 计算属性：总人数
const totalCount = computed(() => {
  return personnelData.value ? personnelData.value.length : 0
})

// 选择人员
const selectPerson = (person) => {
  selectedPerson.value = person
}

// 格式化支行名称
const formatBranchName = (branchName) => {
  if (!branchName) return '-'
  return branchName.replace('东莞农村商业银行', '')
}

// 格式化数字
const formatNumber = (value) => {
  if (value === null || value === undefined || value === '') return '-'
  return Number(value).toFixed(1)
}

// 格式化日期
const formatDate = (dateNum) => {
  if (!dateNum) return '-'
  const str = dateNum.toString()
  if (str.length === 8) {
    return `${str.substring(0, 4)}-${str.substring(4, 6)}-${str.substring(6, 8)}`
  }
  return dateNum
}

// 格式化排名变化
const formatRankChange = (value) => {
  if (value === null || value === undefined || value === '' || value === '-') return '-'
  const num = Number(value)
  if (isNaN(num)) return '-'
  if (num > 0) return `↑${num}`
  if (num < 0) return `↓${Math.abs(num)}`
  return '—'
}

// 获取分数样式类
const getScoreClass = (score) => {
  if (!score) return 'score-poor'
  if (score >= 90) return 'score-excellent'
  if (score >= 80) return 'score-good'
  if (score >= 70) return 'score-normal'
  return 'score-poor'
}

// 获取排名样式类
const getRankClass = (rank) => {
  if (!rank) return 'rank-normal'
  if (rank <= 3) return 'rank-top3'
  if (rank <= 10) return 'rank-top10'
  return 'rank-normal'
}

// 获取排名变化样式类
const getRankChangeClass = (change) => {
  if (!change || change === '-') return ''
  const num = Number(change)
  if (isNaN(num)) return ''
  if (num > 0) return 'rank-up'
  if (num < 0) return 'rank-down'
  return ''
}

// 获取百分比（用于进度条）
const getPercentage = (value, max) => {
  if (!value || !max) return '0%'
  return `${Math.min(100, (value / max) * 100)}%`
}

onMounted(() => {
  console.log('人员画像页面已加载')
  loadData()
})
</script>

<style scoped>
.personnel-portrait-view {
  display: flex;
  width: 100%;
  height: calc(100vh - 90px);
  background: #033c76;
  gap: 15px;
  padding: 15px;
  overflow: hidden;
}

/* ========== 左侧人员列表面板 ========== */
.personnel-list-panel {
  width: 350px;
  flex-shrink: 0;
  background: rgba(6, 30, 93, 0.5);
  border: 1px solid rgba(0, 215, 233, 0.3);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 215, 233, 0.2);
  background: rgba(0, 215, 233, 0.05);
}

.header-title {
  color: #00d7e9;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.header-subtitle {
  color: #8b9dc3;
  font-size: 14px;
}

.personnel-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

/* 人员列表项 */
.personnel-list-item {
  display: flex;
  align-items: center;
  padding: 15px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 215, 233, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.personnel-list-item:hover {
  background: rgba(0, 215, 233, 0.1);
  border-color: rgba(0, 215, 233, 0.5);
  transform: translateX(5px);
}

.personnel-list-item.active {
  background: rgba(0, 215, 233, 0.2);
  border-color: #00d7e9;
}

.person-rank {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #8b9dc3;
  font-weight: bold;
  font-size: 16px;
  margin-right: 15px;
  flex-shrink: 0;
}

.person-rank.rank-top3 {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.person-rank.rank-top10 {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
  color: #333;
}

.person-info {
  flex: 1;
  min-width: 0;
}

.person-name {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-branch {
  color: #8b9dc3;
  font-size: 12px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-position {
  color: #00d7e9;
  font-size: 12px;
}

.person-score {
  text-align: center;
  margin-left: 10px;
  flex-shrink: 0;
}

.score-value {
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 4px;
}

.score-label {
  color: #8b9dc3;
  font-size: 12px;
}

/* 评分颜色 */
.score-excellent {
  color: #52c41a;
}

.score-good {
  color: #00d7e9;
}

.score-normal {
  color: #fac858;
}

.score-poor {
  color: #ff4d4f;
}

/* 左侧加载状态 */
.list-loading, .list-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.loading-spinner-small {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0, 215, 233, 0.2);
  border-top-color: #00d7e9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text-small {
  margin-top: 15px;
  color: #8b9dc3;
  font-size: 14px;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.error-text {
  color: #ff4d4f;
  font-size: 14px;
  margin-bottom: 15px;
  text-align: center;
}

.retry-btn {
  padding: 8px 20px;
  background: #00d7e9;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.retry-btn:hover {
  background: #00c1d4;
}

/* ========== 右侧人员详情面板 ========== */
.personnel-detail-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 滚动条样式 */
.personnel-list-container::-webkit-scrollbar,
.personnel-detail-panel::-webkit-scrollbar {
  width: 8px;
}

.personnel-list-container::-webkit-scrollbar-track,
.personnel-detail-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.personnel-list-container::-webkit-scrollbar-thumb,
.personnel-detail-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 215, 233, 0.4);
  border-radius: 4px;
}

.personnel-list-container::-webkit-scrollbar-thumb:hover,
.personnel-detail-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 215, 233, 0.6);
}

/* 未选择状态 */
.no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.no-selection-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-selection-text {
  color: #8b9dc3;
  font-size: 18px;
}

/* 人员详情内容 */
.personnel-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 人员标题区 */
.personnel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px;
  background: rgba(6, 30, 93, 0.5);
  border: 1px solid rgba(0, 215, 233, 0.3);
  border-radius: 4px;
}

.personnel-title h2 {
  color: #fff;
  font-size: 28px;
  margin: 0 0 10px 0;
}

.title-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8b9dc3;
  font-size: 14px;
}

.meta-item {
  color: #00d7e9;
}

.meta-divider {
  color: rgba(139, 157, 195, 0.5);
}

.personnel-score-display {
  flex-shrink: 0;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

.score-circle.score-excellent {
  border-color: #52c41a;
}

.score-circle.score-good {
  border-color: #00d7e9;
}

.score-circle.score-normal {
  border-color: #fac858;
}

.score-circle.score-poor {
  border-color: #ff4d4f;
}

.score-number {
  font-size: 32px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 8px;
}

.score-text {
  color: #8b9dc3;
  font-size: 14px;
}

/* 详情区块 */
.detail-section {
  padding: 20px;
  background: rgba(6, 30, 93, 0.5);
  border: 1px solid rgba(0, 215, 233, 0.3);
  border-radius: 4px;
}

.section-title {
  color: #00d7e9;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 215, 233, 0.2);
}

/* 信息网格 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-label {
  color: #8b9dc3;
  font-size: 12px;
}

.info-value {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}

.rank-value {
  display: flex;
  align-items: center;
}

.rank-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
}

.rank-badge.rank-top3 {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
}

.rank-badge.rank-top10 {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
  color: #333;
}

.rank-badge.rank-normal {
  background: rgba(0, 215, 233, 0.2);
  color: #00d7e9;
}

.rank-up {
  color: #52c41a;
  font-weight: bold;
}

.rank-down {
  color: #ff4d4f;
  font-weight: bold;
}

/* 分数详情 */
.score-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.score-detail-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-detail-name {
  color: #8b9dc3;
  font-size: 14px;
}

.score-detail-value {
  font-size: 16px;
  font-weight: bold;
}

.score-progress-bar {
  height: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.progress-fill.score-excellent {
  background: linear-gradient(90deg, #52c41a 0%, #7ed321 100%);
}

.progress-fill.score-good {
  background: linear-gradient(90deg, #00d7e9 0%, #00f2ff 100%);
}

.progress-fill.score-normal {
  background: linear-gradient(90deg, #fac858 0%, #ffd666 100%);
}

.progress-fill.score-poor {
  background: linear-gradient(90deg, #ff4d4f 0%, #ff7875 100%);
}

/* 评价内容 */
.evaluation-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.eval-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eval-label {
  color: #00d7e9;
  font-size: 14px;
  font-weight: 500;
}

.eval-text {
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 3px solid #00d7e9;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 1400px) {
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .personnel-portrait-view {
    flex-direction: column;
    height: auto;
  }
  
  .personnel-list-panel {
    width: 100%;
    max-height: 400px;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
}
</style>
